<?php defined('SYSPATH') or die('No direct script access.');

class Model_Mgallery extends ORM
{
   protected $_table_name = 'table_images';
   public function get_all_images()
   {
      return $this->find_all();
   }

   public function get_images($offset, $limit)
   {
      return $this->offset($offset)->limit($limit)->find_all();
   }

   public function insert_image($name_image, $description_image)
   {
      $data = array(
         'name_image' => $name_image, 
         'url_image' => './uploads/'.$name_image, 
         'description_image' => $description_image
      );
      return $this->values($data)->save();
   }
}